
<% form_tag({:controller => :platform, :action => :login, :only_path => false}, {:id => 'login_form'}) do %>
<%= hidden_field_tag "return_to", params[:return_to] -%>
<table class="box" style="font-size: 12px; width: 170px;">
  <tr valign="top"><td><label for="login_key"><span style="font-weight: bold;"><%= "#{CUSTOM_RITERAL[:login_account]}#{CUSTOM_RITERAL[:login_account_example]}" -%></span></label></td></tr>
  <tr valign="top"><td><%= text_field 'login', 'key', { 'size' => 25, 'tabindex' => 1, 'AUTOCOMPLETE' => "on" } -%></td></tr>
  <tr valign="top"><td><label for="login_pwd"><span style="font-weight: bold;"><%= CUSTOM_RITERAL[:login_password] -%></span></label></td></tr>
  <tr valign="top"><td><%= password_field 'login', 'password', { 'size' => 25, :onfocus=>'select();', 'tabindex' => 2, 'AUTOCOMPLETE' => "on" } %></td></tr>
  <tr valign="top"><td><input id="login_save" name="login_save" type="checkbox" value="true" checked tabindex="3" /> 次回から自動的にログイン</td></tr>
  <tr valign="top"><td align="center"><%= submit_tag "ログイン", :onclick=>"saveLoginData();", 'tabindex' => 4 %></td></tr>
  <tr valign="top" align="left"><td>
    <% if SSL_SETTING %>
    <div style="margin-top: 15px; _margin-top: 0px;">
      <span style="border-right:1px solid gray;padding-right: 5px;"><%= radio_button_tag "ssl_enable", false, false, :id => "ssl_disable_radio" %>http</span>
      <%= radio_button_tag "ssl_enable", true, false, :id => "ssl_enable_radio" %>https
    </div>
    <% end %>
  </td></tr>
  <tr valign="top"><td><%= link_to 'パスワードを忘れた方はこちら', {:controller => :remind_password, :action => :index}, {:style => 'font-size:11px'} -%></td></tr>
</table>
<% end %>

<script type="text/javascript">
$j(function(){
    var loadLoginData = function(){
        login_save = (loadCookie('login_save') == '') ? false : eval(loadCookie('login_save'));
        $j('#login_save').attr('checked', login_save);
        ssl_enable = (loadCookie('ssl_enable') == '') ? false : eval(loadCookie('ssl_enable'));
        $j('#ssl_enable_radio').attr('checked', ssl_enable);
        $j('#ssl_disable_radio').attr('checked', !ssl_enable);
        $j('#login_key').focus();
    };
    loadLoginData();
    $j('#login_form')
    .submit(function(){
        if($j('#ssl_enable_radio:checked').size() > 0) {
            $j(this).attr('action', $j(this).attr('action').replace('http://', 'https://'));
        }
    });
})
</script>
